package com.qf.dao;

import com.qf.pojo.Setmeal;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zhouhao
 * @create 2021-12-22 20:07
 */
public interface SetMealDao {

    //添加套餐
    void add(Setmeal setmeal);

    //添加套餐中关联的检查组
    @Insert("insert into t_setmeal_checkgroup(setmeal_id,checkgroup_id) values (#{setmealId},#{checkgroupId})")
    void addSetmealAndCheckGroupBySetmealId(HashMap<String, Object> map);

    //分页查询套餐
    List<Setmeal> findByCondition(String queryString);

    //查询所有套餐
    List<Setmeal> getAllSetMeal();

    //根据id查询套餐的详细信息
    Setmeal findById(Integer id);

    //获取套餐统计数据
    List<Map<String, Object>> findSetmealAndCount();
}
